home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / efun / trace < prev    next >
Text File  |  2001-04-04  |  2KB  |  58 lines

  1. SYNOPSIS
  2.         #include <trace.h>
  3.  
  4.         int trace(int traceflags)
  5.  
  6. DESCRIPTION
  7.         Sets the trace flags and returns the old trace flags. When
  8.         tracing is on, a lot of information is printed during
  9.         execution and too much output can crash your connection or
  10.         even the whole driver.
  11.  
  12.         Tracing is done on a per-connection basis: each interactive(!)
  13.         user may specifiy their own tracelevel and -prefix. Each gets the
  14.         traceoutput for just the code executed during the evaluation
  15.         of the commands he entered.
  16.  
  17.         The trace bits are:
  18.  
  19.           TRACE_NOTHING     (  0): stop tracing.
  20.  
  21.           TRACE_CALL        (  1): trace all calls to lfuns.
  22.           TRACE_CALL_OTHER  (  2): trace call_others()s.
  23.           TRACE_RETURN      (  4): trace function returns.
  24.           TRACE_ARGS        (  8): print function arguments and results.
  25.           TRACE_EXEC        ( 16): trace all executed instructions.
  26.           TRACE_HEART_BEAT  ( 32): trace heartbeat code.
  27.           TRACE_APPLY       ( 64): trace driver applies.
  28.           TRACE_OBJNAME     (128): print the object names.
  29.  
  30.         TRACE_EXEC and TRACE_HEART_BEAT should be avoided as they cause
  31.         massive output! TRACE_OBJNAME should be avoided when you know
  32.         what you trace.
  33.  
  34.  
  35.         The master-lfun valid_trace() is called with ("trace", traceflags)
  36.         as argument to verify the use of this efun.
  37.  
  38. EXAMPLE
  39.         object obj;
  40.         string prefix;
  41.         obj=find_player("wessex");
  42.         prefix=object_name(obj);
  43.         prefix=prefix[1..strlen(prefix)-1]; /* cut off the leading "/" */
  44.         traceprefix(prefix);
  45.           /* From here on, only code in the object "std/player#69"
  46.            * will be traced.
  47.            */
  48.         trace(TRACE_CALL|TRACE_CALL_OTHER|TRACE_RETURN|TRACE_ARGS);
  49.         ...
  50.         trace(TRACE_NOTHING);
  51.  
  52. HISTORY
  53.         LDMud 3.2.9 passes the <traceflags> argument to the valid_trace()
  54.             apply as well.
  55.  
  56. SEE ALSO
  57.         traceprefix(E)
  58.